<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="author" content="林镭特">
    <title></title>
    <style>
        
    </style>
</head>
<body>
    <div>已经输入<span>0</span>个字</div>
    <textarea name="" id="" cols="50" rows="10" placeholder="请输入想说的话"></textarea>

    <script src="jQuery.js"></script>
<script>
     $('textarea').on('input',function () {
        $('span').text($(this).val().length);
        if($(this).val().length > 140) {
            $('span').css('color','red')
        }else{
            $('span').css('color','black')
        }
    })
</script>
</body>
</html>